package com.gxust.service.impl;

import com.gxust.mapper.AddressMapper;
import com.gxust.pojo.Address;
import com.gxust.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 功能：
 * 作者：zjk
 * 日期：2023/11/27 20:50
 */
@Service
public class AddressServiceImpl implements AddressService {


    @Autowired
    private AddressMapper addressMapper;

    @Override
    public void insertAddress(Address address) {
            addressMapper.insertAddress(address);
    }

    @Override
    public void deleteById(Integer id) {
        addressMapper.deleteById(id);
    }

    @Override
    public void update(Address address) {
        addressMapper.update(address);
    }

    @Override
    public List<Address> getAddress(Integer userId) {
        return addressMapper.getAddressByUserId(userId);
    }
}